from types import SimpleNamespace


class ConvertUtils:
    @classmethod
    def convert_to_dict(cls, obj):
        if isinstance(obj, SimpleNamespace):
            obj_dict = vars(obj)
            for key, value in obj_dict.items():
                obj_dict[key] = cls.convert_to_dict(value)
            return obj_dict
        elif isinstance(obj, list):
            return [cls.convert_to_dict(item) for item in obj]
        elif isinstance(obj, tuple):
            return tuple(cls.convert_to_dict(item) for item in obj)
        elif isinstance(obj, dict):
            return {cls.convert_to_dict(key): cls.convert_to_dict(value) for key, value in obj.items()}
        else:
            return obj
